package ui20131001.helper
{
	import bMap.BMapCanvas;

	public class MapTypeManager
	{
		public static const google_map:int = 1;
		public static const google_sate:int = 2;
		public static const baidu_map:int = 3;
		public static const baidu_sate:int = 4;
		
		public static var currentMapType:int = 1;
		
		private static var _map:Maper;
		
		public static function setMaper(map:Maper):void
		{
			_map = map;
		}
		
		public static function setMapType(type:int):void
		{
			if(_map)
			{
				switch(type)
				{
					case google_map:
						currentMapType = google_map;
						Global.currentMapType = 1;
						_map.mapCanvas.changeMapType();
						break;
					case google_sate:
						currentMapType = google_sate;
						Global.currentMapType = 2;
						_map.mapCanvas.changeMapType();
						break;
					case baidu_map:
						currentMapType = baidu_map;
						_map.baiMap.setMapType();
						break;
					case baidu_sate:
						currentMapType = baidu_sate;
						_map.baiMap.setMapType();
						break;
				}
				if(currentMapType==google_map || currentMapType==google_sate)
				{
					_map.mapCanvas.visible = true;
					_map.baiMap.visible = false;
				}else
				{
					_map.mapCanvas.visible = false;
					_map.baiMap.visible = true;
				}
			}
		}
		
		public static function get isSate():Boolean
		{
			return currentMapType==google_sate || currentMapType==baidu_sate;
		}
		
	}
}